public class Test05 {
    static void main() {
        for(int i = 1998; i <= 2024; ++i) {
            if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
                System.out.println(i);
            }
        }
    }
}
